﻿@model IEnumerable<UNFEventPosting.Models.Event>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<script src="@Url.Content("~/Scripts/Event_Index.js")" type="text/javascript"></script>

<p>
    @Html.ActionLink("Create New", "Create")
</p>

<div class="editor-label">
    Sort by Category
</div>
<div class="editor-field">
    @Html.DropDownList("CategoryID", String.Empty)
</div>

<table>
    <tr>
        <th>
            Name
        </th>
        <th>
            Category
        </th>
        <th>
            Description
        </th>
        <th>
            Start Date-Time
        </th>
        <th>
            End Date-Time
        </th>
        <th>
            Location
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Category.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.StartTime)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.EndTime)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Location)
        </td>
        <td>
            @Html.ActionLink("Details", "Details", new { id=item.ID })
        </td>
    </tr>
}

</table>
